<?php

namespace App\AgentAdmin\Metrics\Examples;

use Dcat\Admin\Admin;
use Dcat\Admin\Widgets\Metrics\Donut;
use Illuminate\Http\Request;
use Carbon\Carbon;
use App\Models\AgentAccount;

class Agent extends Donut
{

    /**
     * 初始化卡片内容
     */
    protected function init()
    {
        parent::init();

        $this->title('您的代理 ID');
    }

    /**
     * 处理请求
     *
     * @param Request $request
     *
     * @return mixed|void
     */
    public function handle(Request $request)
    {
        $this->withContent();

    }
    

    /**
     * 设置卡片头部内容.
     *
     * @param mixed $desktop
     * @param mixed $mobile
     *
     * @return $this
     */
    protected function withContent()
    {
        $id = Admin::user()->id;
        return $this->content(
            <<<HTML
<div class=" mt-1" style="margin-bottom: 2px">
    <h2 class="ml-1 font-lg-1">{$id}</h2>
</div>
HTML
        );
    }
}
